package jms;

import java.util.Properties;

import com.aliyun.openservices.ons.api.Message;
import com.aliyun.openservices.ons.api.ONSFactory;
import com.aliyun.openservices.ons.api.Producer;
import com.aliyun.openservices.ons.api.PropertyKeyConst;
import com.aliyun.openservices.ons.api.SendResult;

import vo.Store;


public class JmsMs {
	public void sendVerify(int sailId){
	   Properties properties = new Properties();
       properties.put(PropertyKeyConst.ProducerId, "PID_testd");
       properties.put(PropertyKeyConst.AccessKey, "IEbGs6h4OluNQ3ky");
       properties.put(PropertyKeyConst.SecretKey, "d79kJ6SrX3yHk802vC1b5qrdg7OIjm");
       Producer producer = ONSFactory.createProducer(properties);
	            
	       producer.start();
	       Message msg = new Message(
	            //Message Topic
	            "test12","TagA",(sailId+"").getBytes()
	        );
	         
	        msg.setKey("ORDERID_100");
	         
	        SendResult sendResult = producer.send(msg);
	        System.out.println(sendResult);
	 
	        producer.shutdown();
	}
	public static void main(String[] args) {
		JmsMs jm=new JmsMs();
		jm.sendVerify(1);
	}
}
